<%@ page import="java.util.jar.Attributes.Name"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="support.*,java.util.*" %>
    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Address</title>
<link href="main.css" rel="stylesheet" type="text/css">
</head>
<body>

<%
	// Get citizenship from HTTP request
	String country = request.getParameter("residence");
	String countryID = request.getParameter("residenceID");

	Applicant a = (Applicant) session.getAttribute("applicant");
	a.setResidence(new Country(Integer.valueOf(countryID), country));
	
	// Store applicant in session
	session.setAttribute("applicant", a);
	
%>
<jsp:include page="information.jsp"></jsp:include>

<h1>Please enter your address</h1>
<form name="form1" action="degree_location.jsp" method="post">
Street:<input type="text" name="street"><br />
City:<input type="text" name="city"><br />
<% 
if (countryID.equals("213")){ 
	out.println("State:<input type=\"text\" name=\"state\"><br />");
}
%>
Zipcode:<input type="text" name="zipcode"><br />
Phone number:
<% 
if (!countryID.equals("213")){ 
	out.println("+<input type=\"text\" name=\"countrycode\" size=3>");
}
%>
<input type="text" name="areacode" size=4><input type="text" name="phone" size=10><br />
<input type="hidden" name="from" value="address">
<input type="submit" value="Submit">
</form>
</body>
</html>